﻿<!DOCTYPE HTML>
<html>
<head th:include="fragments/_header :: _head('用户提现')"></head>
<body>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray">
		<span class="l">
		</span>
		<span class="r">共有数据：<strong th:text="${page.total}">0</strong> 条</span>
	</div>
	<div class="text-c mt-20">
		<form action="/withdraw/list" id="searchForm">
			<input type="hidden" name="page" id="page" th:value="${page.current}">
			<select name="type">
				<option value="-1" th:selected="${type==-1}">全部</option>
				<option value="0" th:selected="${type==0}">待支付</option>
				<option value="1" th:selected="${type==1}">已支付</option>
			</select>
			<button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</form>
	</div>
	<div class="dataTables_wrapper no-footer  mt-20">
		<table class="table table-border table-bordered table-bg">
			<thead>
				<tr>
					<th scope="col" colspan="6">用户提现列表</th>
				</tr>
				<tr class="text-c">
					<th width="50">用户ID</th>
					<th width="150">用户名</th>
					<th width="100">数量</th>
					<th width="100">状态</th>
					<th width="130">申请时间</th>
					<th width="150">操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="text-c"  th:each="withdraw:${page.records}">
					<td th:text="${withdraw.userId}">history</td>
					<td th:text="${withdraw.username}">history</td>
					<td th:text="${withdraw.count}">history</td>
					<td class="td-status" th:if="${withdraw.status==0}"><span class="label radius">待支付</span></td>
					<td class="td-status" th:if="${withdraw.status==1}"><span class="label radius label-success">已支付</span></td>
					<td  th:text="${#dates.format(withdraw.timestamp, 'yyyy-MM-dd HH:mm:ss')}">2014-6-11 11:11:42</td>
					<td class="td-manage">
						<a style="text-decoration:none" class="btn btn-danger radius" th:aid="${withdraw.id}" href="javascript:;" th:if="${withdraw.status eq 0}" onclick="pay(this)"  title="支付">支付</a>
					</td>
				</tr>
			</tbody>
		</table>
		<div th:replace="fragments/_page :: pageBar(${page})"></div>
		<div th:replace="fragments/_page :: pagination(${page})"></div>
	</div>
</div>
<div th:include="fragments/_footer :: _footer"></div>
<script th:replace="fragments/_page :: pageScript"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
	/*管理员-停用*/
	function pay(obj){
		var id = $(obj).attr("aid");
		layer.confirm('确认已经支付现金给用户了？', function (index) {
			$.post("/withdraw/pay", {id: id}, function (result) {
				if (result.success) {
					window.location.reload();
				} else {
					layer.msg(result.msg, {icon: 2, time: 1000});
				}
			});
		});
	}

</script>
</body>
</html>